#ifndef OOPOPERATION_H
#define OOPOPERATION_H

#include <QWidget>
#include <QLabel>
#include <QComboBox>
#include <QPushButton>
#include <QGridLayout>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QTextBrowser>
#include <QLineEdit>
#include <QDebug>
#include <QListWidget>
#include <QListWidgetItem>
#include <QStackedWidget>
#include <QStackedLayout>
#include <QGridLayout>
#include <QGroupBox>
#include <QCheckBox>
#include <QTimerEvent>
#include <QTimer>
#include <QProgressBar>
#include "global_var.h"
#include "protocol13761.h"
#include "protocol_oop.h"
class oopOperation : public QWidget
{
    Q_OBJECT
public:
    explicit oopOperation(QWidget *parent = nullptr);

signals:
    void sendframeSignal_param_page();
      void flushPageShow();

public slots:

        void updatePageShowSlot();
        //升级相关槽函数
        void update_file_broswer_slot();
        void update_start_slot();
        void update_close_slot();




private:
    protocol13761  protocol376;
    protocol_oop   protocoloop;
    QPushButton  *itemRead,*itemSend;
     QLineEdit *passwordInput;
    QListWidget * paramList;
    QListWidgetItem *paramBLEupdate;  // 蓝牙代理升级。
    void  paramBLEupdateWidgetInit(); // 蓝牙升级界面初始化。
    QWidget *paramBLEupdateWidget;
    QGridLayout  *UpdateBLEGridLayout;
    QLabel   *UpdateBLEFilePathLabel;
    QPushButton *UpdateBLEFileButton;
    QLineEdit   *UpdateBLEFilePath_Edit;
    QPushButton   *UpdateBLEStart,*UpdateBLEEnd;
    QString fileName;
    QFile   updateFileHandler;
    INT8U   updateFile[512*1024];
    INT32U BLEUpdateFIleCRC;
    int   updateFileLen,file_total_seg,file_cur_seg;
    void  make_376update_frame();
     int timerUpdate,retransmitCnt,intoUpdateState,total_packetNum,nowPacketNum; //10S 超时重发,重发3次。
     QProgressBar  *progressbar;



    QStackedLayout *stack;  //堆栈式窗体

    QHBoxLayout  *CtrlbuttonLayout;
    QHBoxLayout  *setItemLayout;
    QVBoxLayout  *setMainLayout;
};

#endif // OOPOPERATION_H
